<template>
  <div class="container">
    <card title="马甲包状态">
      <div class="asm-table">
        <div class="asm-tr">
          <div class="asm-th asm-grow-1">序号</div>
          <div class="asm-th">名称</div>
          <div class="asm-th">包名</div>
          <div class="asm-th">状态</div>
        </div>
        <div class="asm-tr" v-if="isLoading">
          <loading></loading>
        </div>
        <div class="asm-tr asm-no-data" v-else-if="list.length < 1"></div>
        <div class="asm-tr" v-for="(item, index) in list" v-else>
          <div class="asm-td asm-grow-1">{{index + 1}}</div>
          <div class="asm-td">{{item.app_name || '---'}}</div>
          <div class="asm-td">{{item.source_app}}</div>
          <div class="asm-td">
              <span class="tag is-primary" v-if="item.is_open">开启</span>
              <span class="tag is-light" v-else>关闭</span>
          </div>
        </div>
      </div>
    </card>
  </div>
</template>
<script>
export default {
  name: 'assistant',
  created () {
    this.isLoading = true
    this.$api.get('assistant/all').then(req => {
      this.list = req
      this.isLoading = false
    })
  },
  data () {
    return {
      isLoading: false,
      list: []
    }
  }
}
</script>
<style lang="scss" scoped>
@import '~@/scss/table.scss';
</style>


